import Enum from '../constants/Enum'
import { CHANGE_METHOD } from '../constants/counter'

const initialState = {
  method: {
    type: Enum.addition,
    range: Enum.range_0_9
  }
}

export default (state = initialState, action) => {
  switch (action.type) {
    case CHANGE_METHOD:
      return {
        ...state,
        method: action.value
      }
  }
  return state
}
